import java.util.Scanner;

public class EachDigit {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        System.out.println("请输入一个数：");
        int n = scan.nextInt();
        eachDigit(n);
    }

    public static void eachDigit(int a) {
        if (a < 10) {
            System.out.println(a);
            return;
        } else {
            eachDigit(a / 10);
            System.out.println(a % 10);
            return;
        }
    }
}
